home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_nub_pathback.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  92 lines

  1. # Jones 3D Cog Script
  2. #
  3. # NUB_PathBack.cog
  4. #
  5. # [GGJ]
  6. #
  7. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  8. #
  9. # ========================================================================================
  10. symbols
  11.  
  12. message        startup
  13. message        damaged
  14. message        arrived
  15. message        activated
  16.  
  17. thing        player            local
  18. thing        door
  19. thing        socket0            mask=0x8
  20. thing        socket1            mask=0x8
  21.  
  22. sound        startDoorSnd=nub_stonedoor_start_c.wav        local
  23. sound        moveDoorSnd=nub_stonedoor_move_c.wav        local
  24. sound        stopDoorSnd=nub_stonedoor_stop_c.wav        local
  25.  
  26.  
  27. # right key lines...
  28. sound    open0=Inxj103.wav                local # Whoa! It opened.
  29. sound    open1=Inxj111.wav                local # what...know...worked!
  30.  
  31. # door locked lines...
  32. sound    locked0=Inxj096.wav                local # I can't open it-->insayline[25]
  33. sound    locked1=Inxj097.wav            local # For some reason...won't open.
  34. sound    locked2=Inxj102.wav                local # must be way...don't know how.
  35.  
  36.  
  37. int            opened=0        local
  38. int            move0Channel    local
  39. int            talking=0        local
  40. end
  41.  
  42. # ========================================================================================
  43. code
  44.  
  45. startup:
  46.  
  47. player = GetLocalPlayerThing();
  48.  
  49. return;
  50.  
  51. # ........................................................................................
  52. activated:
  53. if (talking == 1) return;
  54.  
  55. if ((GetSenderRef() == door) || (GetSenderRef() == socket0))
  56. {
  57.     talking = 1;
  58.     PlayVoice(player, locked0[randbetween(0, 2)], 1, 1);
  59.     talking = 0;
  60. }
  61. return;
  62. # ........................................................................................
  63. damaged:
  64. if (opened == 1) return;
  65.  
  66. # if player activates socket WITH IMP #4 and door is closed
  67. if (((GetSenderRef() == socket0) || (GetSenderRef() == socket1))  && (GetParam(1) == 0x4000))
  68.     {
  69.     opened = 1;
  70.     
  71.     PlaySoundThing(startDoorSnd, door, 1.0, -1, -1, 0);
  72.     move0Channel = PlaySoundThing(moveDoorSnd, door, 1.0, -1, -1, 0x1);
  73.     MoveToFrame(door, 1 - GetCurFrame(door), 1.0);
  74.     PlayVoice(player, open0[randbetween(0, 1)], 1, 0);
  75.     Sleep(2.0);
  76.     opened = 0;
  77.     
  78.     }
  79. return;
  80.  
  81. # ........................................................................................
  82. arrived:
  83. if (GetSenderRef() == door)
  84. {
  85.     StopSound(move0channel, 0.0);
  86.     PlaySoundThing(stopDoorSnd, door, 1.0, -1, -1, 0);
  87. }
  88. return;
  89.  
  90. # ........................................................................................
  91. end
  92.